+
    *:žgce  ã                  ó   € R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHtH	t	 ^ RI
Ht ^ RIHtHt ^ RIHtHt ]'       d   ^ RIHtHt ^ R	IHt R
 R ltR R ltR R lt ! R R]4      t ! R R4      t ! R R4      tR.R R llt]P<                  ! R4      tR R lt R/R R llt!R R lt"R0R! R" llt#R#RR$R R%RR&RR'RR(RR)^L/R* R+ llt$R, R- lt%R# )1zÖ
babel.messages.pofile
~~~~~~~~~~~~~~~~~~~~~

Reading and writing of files in the ``gettext`` PO (portable object)
format.

:copyright: (c) 2013-2025 by the Babel Team.
:license: BSD, see LICENSE for more details.
)ÚannotationsN)ÚIterable)ÚTYPE_CHECKINGÚLiteral)ÚLocale)ÚCatalogÚMessage)ÚTextWrapperÚ_cmp)ÚIOÚAnyStr)ÚSupportsWritec               ó    € V ^8„  d   QhRRRR/# ©é   ÚstringÚstrÚreturn© )Úformats   "Ú7/usr/lib/python3/dist-packages/babel/messages/pofile.pyÚ__annotate__r      s   € ÷ Jñ J�Sð J˜Sñ Jó    c                óX   € R p\         P                  ! R4      P                  W^R 4      # )z§Reverse `escape` the given string.

>>> print(unescape('"Say:\\n  \\"hello, world!\\"\\n"'))
Say:
  "hello, world!"
<BLANKLINE>

:param string: the string to unescape
c                ó^   € V P                  ^4      pVR8X  d   R# VR8X  d   R# VR8X  d   R# V# )é   ÚnÚ
ÚtÚ	ÚrÚ)Úgroup)ÚmatchÚms   & r   Úreplace_escapesÚ!unescape.<locals>.replace_escapes&   s2   € Ø�K‰K˜‹NˆØ�Œ8ÙØ�#ŒXÙØ�#ŒXÙàˆr   z\\([\\trn"])éÿÿÿÿ)ÚreÚcompileÚsub)r   r%   s   & r   Úunescaper+      s)   € ò	ô �:Š:�oÓ&×*Ñ*¨?À1ÀR¸LÓIÐIr   c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r   3   s   € ÷  ñ  ˜ð   ñ  r   c                óÈ   € RV 9   dR   V P                  4       pV P                  R4      '       d
   VR,          p\        \        V4      pRP	                  V4      # \        V 4      # )a¬  Reverse the normalization done by the `normalize` function.

>>> print(denormalize(r'''""
... "Say:\n"
... "  \"hello, world!\"\n"'''))
Say:
  "hello, world!"
<BLANKLINE>

>>> print(denormalize(r'''""
... "Say:\n"
... "  \"Lorem ipsum dolor sit "
... "amet, consectetur adipisicing"
... " elit, \"\n"'''))
Say:
  "Lorem ipsum dolor sit amet, consectetur adipisicing elit, "
<BLANKLINE>

:param string: the string to denormalize
r   ú""ºr   NNÚ )Ú
splitlinesÚ
startswithÚmapr+   Újoin)r   Úescaped_linesÚliness   &  r   Údenormalizer7   3   sY   € ð* ˆv„~Ø×)Ñ)Ó+ˆØ×Ñ˜T×"Ò"Ø)¨"Õ-ˆMÜ”H˜mÓ,ˆØ�w‰w�u‹~Ðä˜ÓÐr   c               ó    € V ^8„  d   QhRRRR/# )r   Úliner   r   z	list[str]r   )r   s   "r   r   r   R   s   € ÷ )ñ )˜Sð ) Yñ )r   c                óÌ  € RV 9  d&   RV 9  d   V P                  4       P                  4       # . pRpRpV  F  pVR8X  d   V'       d   \        R4      hRpK!  VR8X  d   V'       g   \        R4      hRpK?  VR8X  d2   V'       d   W$,          pKX  V'       d   VP                  V4       RpKu  Kw  W$,          pK�  	  V'       d%   V'       d   \        R4      hVP                  V4       V# )	zéExtract locations from location comments.

Locations are extracted while properly handling First Strong
Isolate (U+2068) and Pop Directional Isolate (U+2069), used by
gettext to enclose filenames with spaces and tabs in their names.
õ   â�¨õ   â�©r0   Fzglocation comment contains more First Strong Isolate characters, than Pop Directional Isolate charactersTzglocation comment contains more Pop Directional Isolate characters, than First Strong Isolate charactersÚ )ÚlstripÚsplitÚ
ValueErrorÚappend)r9   Ú	locationsÚlocationÚin_filenameÚcs   &    r   Ú_extract_locationsrF   R   sõ   € ð �tÔ °Ô 4Ø�{‰{‹}×"Ñ"Ó$Ð$à€IØ€HØ€KÛˆØ�Œ=ßÜ ð "Wó Xð XàˆKÙØ�(Œ]ßÜ ð "Tó Uð UàˆKÙØ�#ŒXßØ•’ßØ× Ñ  Ô*Ø’ñ ð �MŠHñ) ÷, ßÜ ð "Wó Xð Xà×Ñ˜XÔ&àÐr   c                  ó2   a € ] tR t^~tRtR V 3R lltRtV ;t# )ÚPoFileErrorzDException thrown by PoParser when an invalid po file is encountered.c          
     ó,   € V ^8„  d   QhRRRRRRRRRR	/# )
r   Úmessager   Úcatalogr   r9   ÚlinenoÚintr   ÚNoner   )r   s   "r   r   ÚPoFileError.__annotate__�   s0   € ÷ ñ  ð ¨gð ¸Sð È#ð ÐRVñ r   c                	óT   <€ \         SV `  V R V 24       W n        W0n        W@n        R# )z on N)ÚsuperÚ__init__rK   r9   rL   )ÚselfrJ   rK   r9   rL   Ú	__class__s   &&&&&€r   rR   ÚPoFileError.__init__�   s*   ø€ Ü‰Ñ˜G˜9 D¨¨Ð1Ô2ØŒØŒ	ØŽr   )rK   r9   rL   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rR   Ú__static_attributes__Ú__classcell__)rT   s   @r   rH   rH   ~   s   ø† ÙN÷ö r   rH   c                  ó¦   € ] tR t^ˆtR R ltR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltRtR# )Ú_NormalizedStringc               ó    € V ^8„  d   QhRRRR/# )r   Úargsr   r   rN   r   )r   s   "r   r   Ú_NormalizedString.__annotate__Š   s   € ÷ ñ ˜cð  dñ r   c                	óH   € . V n         V F  pV P                  V4       K  	  R # ©N)Ú_strsrA   )rS   r`   Úargs   &* r   rR   Ú_NormalizedString.__init__Š   s   € Ø "ˆŒ
ÛˆCØ�K‰K˜Öó r   c               ó    € V ^8„  d   QhRRRR/# )r   Úsr   r   rN   r   )r   s   "r   r   ra   �   s   € ÷ %ñ %˜ð % ñ %r   c                	óX   € V P                   P                  VP                  4       4       R # rc   )rd   rA   Ústrip)rS   rh   s   &&r   rA   Ú_NormalizedString.append�   s   € Ø�
‰
×Ñ˜!Ÿ'™'›)Ö$r   c               ó   € V ^8„  d   QhRR/# ©r   r   r   r   )r   s   "r   r   ra   ’   s   € ÷ 2ñ 2˜Sñ 2r   c                	óT   € R P                  \        \        V P                  4      4      # ©r0   )r4   r3   r+   rd   ©rS   s   &r   r7   Ú_NormalizedString.denormalize’   s   € Ø�w‰w”sœ8 T§Z¡ZÓ0Ó1Ð1r   c               ó   € V ^8„  d   QhRR/# )r   r   Úboolr   )r   s   "r   r   ra   •   s   € ÷  ñ  ˜$ñ  r   c                	ó,   € \        V P                  4      # rc   )rs   rd   rp   s   &r   Ú__bool__Ú_NormalizedString.__bool__•   s   € Ü�D—J‘JÓÐr   c               ó   € V ^8„  d   QhRR/# rm   r   )r   s   "r   r   ra   ˜   s   € ÷ +ñ +˜#ñ +r   c                	óT   € \         P                  P                  V P                  4      # rc   )ÚosÚlinesepr4   rd   rp   s   &r   Ú__repr__Ú_NormalizedString.__repr__˜   s   € Ü�z‰z�‰˜tŸz™zÓ*Ð*r   c               ó    € V ^8„  d   QhRRRR/# )r   ÚotherÚobjectr   rM   r   )r   s   "r   r   ra   ›   s   € ÷ +ñ +˜Vð +¨ñ +r   c                	óR   € V'       g   ^# \        \        V 4      \        V4      4      # )r   )r
   r   ©rS   r~   s   &&r   Ú__cmp__Ú_NormalizedString.__cmp__›   s   € ßÙä”C˜“Iœs 5›zÓ*Ð*r   c               ó    € V ^8„  d   QhRRRR/# ©r   r~   r   r   rs   r   )r   s   "r   r   ra   ¡   ó   € ÷ 'ñ '˜Fð ' tñ 'r   c                	ó*   € V P                  V4      ^ 8„  # ©é    ©r‚   r�   s   &&r   Ú__gt__Ú_NormalizedString.__gt__¡   ó   € Ø�|‰|˜EÓ" QÑ&Ð&r   c               ó    € V ^8„  d   QhRRRR/# r…   r   )r   s   "r   r   ra   ¤   r†   r   c                	ó*   € V P                  V4      ^ 8  # rˆ   rŠ   r�   s   &&r   Ú__lt__Ú_NormalizedString.__lt__¤   r�   r   c               ó    € V ^8„  d   QhRRRR/# r…   r   )r   s   "r   r   ra   §   ó   € ÷ (ñ (˜Fð ( tñ (r   c                	ó*   € V P                  V4      ^ 8¬  # rˆ   rŠ   r�   s   &&r   Ú__ge__Ú_NormalizedString.__ge__§   ó   € Ø�|‰|˜EÓ" aÑ'Ð'r   c               ó    € V ^8„  d   QhRRRR/# r…   r   )r   s   "r   r   ra   ª   r“   r   c                	ó*   € V P                  V4      ^ 8*  # rˆ   rŠ   r�   s   &&r   Ú__le__Ú_NormalizedString.__le__ª   r—   r   c               ó    € V ^8„  d   QhRRRR/# r…   r   )r   s   "r   r   ra   ­   r“   r   c                	ó*   € V P                  V4      ^ 8H  # rˆ   rŠ   r�   s   &&r   Ú__eq__Ú_NormalizedString.__eq__­   r—   r   c               ó    € V ^8„  d   QhRRRR/# r…   r   )r   s   "r   r   ra   °   r“   r   c                	ó*   € V P                  V4      ^ 8g  # rˆ   rŠ   r�   s   &&r   Ú__ne__Ú_NormalizedString.__ne__°   r—   r   )rd   N)rV   rW   rX   rY   rR   rA   r7   ru   r{   r‚   r‹   r�   r•   rš   rž   r¢   r[   r   r   r   r^   r^   ˆ   sC   † õõ
%õ2õ õ+õ+õ'õ'õ(õ(õ(÷(ñ (r   r^   c                  ó¦   € ] tR t^´tRt. ROtRR R lltR R ltR R ltR R	 lt	RR
 R llt
RR R lltR R ltR R ltR R ltR R ltRtR# )ÚPoFileParserzŠSupport class to  read messages from a ``gettext`` PO (portable object) file
and add them to a `Catalog`

See `read_po` for simple cases.
c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rK   r   Úignore_obsoleters   Úabort_invalidr   rN   r   )r   s   "r   r   ÚPoFileParser.__annotate__Â   s*   € ÷ $ñ $ ð $¸$ð $ÐW[ð $Ðhlñ $r   c                	óf   € Wn         W n        ^ V n        ^ V n        W0n        V P                  4        R# )r‰   N)rK   r§   ÚcounterÚoffsetr¨   Ú_reset_message_state)rS   rK   r§   r¨   s   &&&&r   rR   ÚPoFileParser.__init__Â   s-   € ØŒØ.ÔØˆŒØˆŒØ*ÔØ×!Ñ!Ö#r   c               ó   € V ^8„  d   QhRR/# ©r   r   rN   r   )r   s   "r   r   r©   Ê   s   € ÷  ñ   dñ  r   c                	ó    € . V n         . V n        . V n        . V n        . V n        . V n        R V n        RV n        RV n        RV n	        RV n
        R # )NF)ÚmessagesÚtranslationsrB   ÚflagsÚuser_commentsÚauto_commentsÚcontextÚobsoleteÚin_msgidÚ	in_msgstrÚ
in_msgctxtrp   s   &r   r­   Ú!PoFileParser._reset_message_stateÊ   sR   € ØˆŒØˆÔØˆŒØˆŒ
ØˆÔØˆÔØˆŒØˆŒØˆŒØˆŒØˆŽr   c               ó   € V ^8„  d   QhRR/# r°   r   )r   s   "r   r   r©   ×   s   € ÷ $ñ $˜dñ $r   c                ó(  € V P                   P                  4        \        V P                  4      ^8”  dB   \        ;QJ d    . R V P                   4       F  NK  	  5M! R V P                   4       4      pM!V P                  ^ ,          P                  4       p\        V\        \        34      '       d›   \        V P                  P                  4       Uu. uF  pRNK  	  ppV P                    FP  w  rEW@P                  P                  8¼  d    V P                  RV P                  R4       K>  VP                  4       W4&   KR  	  \	        V4      pM(V P                   ^ ,          ^,          P                  4       pV P                  '       d   V P                  P                  4       MRp\        W\        V P                  4      \!        V P"                  4      V P$                  V P&                  V P                  ^,           VR7      pV P(                  '       dE   V P*                  '       g2   WpP                  P(                  V P                  P-                  W4      &   MWpP                  V&   V ;P.                  ^,          un        V P1                  4        R# u upi )zw
Add a message to the catalog based on the current parser state and
clear the state ready to process the next message.
c              3  ó@   "  € T F  qP                  4       x € K  	  R # 5irc   )r7   )Ú.0r$   s   & r   Ú	<genexpr>Ú,PoFileParser._add_message.<locals>.<genexpr>Þ   s   é € ÐA±=¨aŸ-™-Ÿ/˜/³=ùs   ‚r0   z5msg has more translations than num_plurals of catalogN)rL   r·   )r³   ÚsortÚlenr²   Útupler7   Ú
isinstanceÚlistÚrangerK   Únum_pluralsÚ_invalid_pofiler¬   r·   r   rB   Úsetr´   r¶   rµ   r¸   r§   Ú_key_forr«   r­   )rS   ÚmsgidÚ_r   ÚidxÚtranslationÚmsgctxtrJ   s   &       r   Ú_add_messageÚPoFileParser._add_message×   sÑ  € ð
 	×Ñ×ÑÔ Üˆt�}‰}Ó Ô!ß”EÑA°4·=²=ÓA—E‘EÑA°4·=²=ÓAÓA‰Eà—M‘M !Õ$×0Ñ0Ó2ˆEÜ�eœd¤E˜]×+Ò+Ü"'¨¯©×(@Ñ(@Ô"AÓBÑ"A˜Q“bÑ"AˆFÐBØ$(×$5Ô$5Ñ �ØŸ,™,×2Ñ2Ô2Ø×(Ñ(¨¨T¯[©[Ð:qÔrÙØ)×5Ñ5Ó7�“ñ	 %6ô
 ˜6“]‰Fà×&Ñ& qÕ)¨!Õ,×8Ñ8Ó:ˆFØ04··°�$—,‘,×*Ñ*Ô,À$ˆÜ˜%¬¨d¯n©nÓ)=¼sÀ4Ç:Á:»Ø×,Ñ,¨d×.@Ñ.@ÈÏÉÐWXÍØ")ô+ˆð �=�=ˆ=Ø×'×'Ð'ØOV—‘×%Ñ% d§l¡l×&;Ñ&;¸EÓ&KÑLøà")�L‰L˜ÑØ�Š˜Õ�Ø×!Ñ!Ö#ùò' Cs   ÃJc               ó   € V ^8„  d   QhRR/# r°   r   )r   s   "r   r   r©   ÷   s   € ÷  ñ  ¨ñ  r   c                	ó>  € V P                   '       d‹   V P                  '       gg   V P                  R V P                  RV P                   ^ ,          P	                  4        R24       V P                  P                  ^ \        R 4      .4       V P                  4        R# R# )r0   zmissing msgstr for msgid 'Ú'N)r²   r³   rÊ   r¬   r7   rA   r^   rÒ   rp   s   &r   Ú_finish_current_messageÚ$PoFileParser._finish_current_message÷   s   € Ø�=�=ˆ=Ø×$×$Ð$Ø×$Ñ$ R¨¯©Ð8RÐSW×S`ÑS`ÐabÕSc×SoÑSoÓSqÐRrÐrsÐ6tÔuØ×!Ñ!×(Ñ(¨!Ô->¸rÓ-BÐ)CÔDØ×ÑÖñ	 r   c               ó   € V ^8„  d   QhRR/# r°   r   )r   s   "r   r   r©   þ   s   € ÷ ?ñ ?ÀTñ ?r   c                	ó~   € VP                  R 4      '       d   V P                  W!4       R# V P                  WV4       R# )Ú"N)r2   Ú!_process_string_continuation_lineÚ_process_keyword_line)rS   rL   r9   r¸   s   &&&&r   Ú_process_message_lineÚ"PoFileParser._process_message_lineþ   s/   € Ø�?‰?˜3×ÒØ×2Ñ2°4Ö@à×&Ñ& v°XÖ>r   c               ó   € V ^8„  d   QhRR/# r°   r   )r   s   "r   r   r©     s   € ÷ '2ñ '2ÀTñ '2r   c                	ój  € V P                    FD  p VP                  V4      '       d*   V\        V4      ,          R9   d   V\        V4      R p MKD  KF  	  V P	                  W!R4       R# VR9   d   V P                  4        W0n        VR8X  d   Wn        VR9   d5   RV n        RV n	        V P                  P                  \        V4      4       R# VR	8X  dš   RV n	        RV n        VP                  R4      '       dM   VR
,          P                  R^4      w  rgV P                  P                  \!        V4      \        V4      .4       R# V P                  P                  ^ \        V4      .4       R# VR8X  d   RV n        \        V4      V n        R# R#   \         d    T P	                  Y!R4        EK¤  i ; i)r=   Ú[Nz$Keyword must be followed by a stringz0Start of line didn't match any expected keyword.rÍ   rÑ   FTÚmsgstrr/   Ú])r=   râ   )rÍ   rÑ   )rÍ   Úmsgid_plural)Ú	_keywordsr2   rÄ   Ú
IndexErrorrÊ   r×   r¸   r¬   r»   r¹   r²   rA   r^   rº   r?   r³   rM   r·   )rS   rL   r9   r¸   Úkeywordre   rÏ   Úmsgs   &&&&    r   rÝ   Ú"PoFileParser._process_keyword_line  sƒ  € à—~”~ˆGð[Ø—?‘? 7×+Ò+°´S¸³\Õ0BÀjÔ0PØœs 7›|˜}Ð-�CÙñ 1QÑ+ñ &ð × Ñ  Ð/aÔbÙàÐ*Ô*Ø×(Ñ(Ô*à Œð �gÔØ ŒKàÐ/Ô/Ø#ˆDŒOØ ˆDŒMØ�M‰M× Ñ Ô!2°3Ó!7Ö8à˜Ô Ø!ˆDŒMØ!ˆDŒNØ�~‰~˜c×"Ò"Ø˜r�7Ÿ=™=¨¨aÓ0‘�Ø×!Ñ!×(Ñ(¬#¨c«(Ô4EÀcÓ4JÐ)KÖLà×!Ñ!×(Ñ(¨!Ô->¸sÓ-CÐ)DÖEà˜	Ô!Ø"ˆDŒOÜ,¨SÓ1ˆDŽLñ "øô= ô [Ø×$Ñ$ TÐ3Y×ZÐZð[ús   ‘<FÆF2Æ1F2c               ó   € V ^8„  d   QhRR/# r°   r   )r   s   "r   r   r©   -  s   € ÷ 
ñ 
Àñ 
r   c                	ó4  € V P                   '       d   V P                  R,          pM`V P                  '       d   V P                  R,          ^,          pM3V P                  '       d   V P
                  pMV P                  WR4       R# VP                  V4       R# )r   z<Got line starting with " but not in msgid, msgstr or msgctxtNr'   )r¹   r²   rº   r³   r»   r·   rÊ   rA   )rS   r9   rL   rh   s   &&& r   rÜ   Ú.PoFileParser._process_string_continuation_line-  sh   € Ø�=�=ˆ=Ø—‘˜bÕ!‰AØ�^�^ˆ^Ø×!Ñ! "Õ% aÕ(‰AØ�_�_ˆ_Ø—‘‰Aà× Ñ  Ð/nÔoÙØ	�‰�Žr   c               ó   € V ^8„  d   QhRR/# r°   r   )r   s   "r   r   r©   9  s   € ÷ 8ñ 8¨ñ 8r   c                	óš  € V P                  4        VR ,          P                  R4      '       dˆ   \        VR,          4       Fo  pVP                  R4      pV^ 8¼  d8    \	        W#^,           R 4      pT P                  P                  TRT T34       KR  V P                  P                  VR34       Kq  	  R# VR ,          P                  R4      '       dY   VR,          P                  4       P                  R4       F,  pV P                  P                  VP                  4       4       K.  	  R# VR ,          P                  R4      '       d?   VR,          P                  4       pV'       d   V P                  P                  V4       R# R# V P                  P                  VR ,          P                  4       4       R#   \
         d     EKˆ  i ; i)r/   Ú:ºr   NNNÚ,Ú.)r×   r2   rF   ÚrfindrM   r@   rB   rA   r>   r?   r´   rj   r¶   rµ   )rS   r9   rC   ÚposrL   ÚflagÚcomments   &&     r   Ú_process_commentÚPoFileParser._process_comment9  s^  € à×$Ñ$Ô&à��8×Ñ˜s×#Ò#Ü.¨t°B­xÖ8�Ø—n‘n SÓ)�Ø˜!”8ð!Ü!$ X°A­g¨hÐ%7Ó!8˜ð —N‘N×)Ñ)¨8°D°S¨>¸6Ð*BÖCà—N‘N×)Ñ)¨8°TÐ*:Ö;ó 9ð �"�X× Ñ  ×%Ò%Ø˜R�Ÿ™Ó)×/Ñ/°Ö4�Ø—
‘
×!Ñ! $§*¡*£,Ö/ó 5à�"�X× Ñ  ×%Ò%à˜2•h—n‘nÓ&ˆGßØ×"Ñ"×)Ñ)¨'Ö2ñ ð ×Ñ×%Ñ% d¨2¥h§n¡nÓ&6Ö7øô &ô !Û ð!ús   ÁF:Æ:G
Ç	G
c               ó    € V ^8„  d   QhRRRR/# )r   ÚfileobjúIO[AnyStr] | Iterable[AnyStr]r   rN   r   )r   s   "r   r   r©   T  s   € ÷  ñ  Ð:ð  ¸tñ  r   c           	     ó¶  € \        V4       FÞ  w  r#VP                  4       p\        V\        4      '       g&   VP	                  V P
                  P                  4      pV'       g   KZ  VP                  R4      '       d]   VR,          P                  R4      '       d+   V P                  W#R,          P                  4       RR7       K¹   V P                  V4       KÍ  V P                  W#4       Kà  	  V P                  4        V P                  '       g•   V P                  '       g%   V P                   '       g   V P"                  '       d]   V P$                  P'                  \)        R4      4       V P*                  P'                  ^ \)        R4      .4       V P-                  4        R# R# R#   \         d(   pT P                  Y2\        T4      4        Rp?EKÇ  Rp?ii ; i)	z€
Reads from the file-like object `fileobj` and adds any po file
units found in it to the `Catalog` supplied to the constructor.
Ú#r/   Ú~rñ   T)r¸   Nr.   )Ú	enumeraterj   rÆ   r   ÚdecoderK   Úcharsetr2   rÞ   r>   rø   r@   rÊ   r×   r«   r´   rµ   r¶   r²   rA   r^   r³   rÒ   )rS   rû   rL   r9   Úexcs   &&   r   ÚparseÚPoFileParser.parseT  s`  € ô & gÖ.‰LˆFØ—:‘:“<ˆDÜ˜d¤C×(Ò(Ø—{‘{ 4§<¡<×#7Ñ#7Ó8�ßÙØ�‰˜s×#Ò#Ø˜•8×&Ñ& s×+Ò+Ø×.Ñ.¨v¸Bµx·±Ó7HÐSWÐ.ÖXðEØ×-Ñ-¨dÖ3ð ×*Ñ*¨6Ö8ñ /ð" 	×$Ñ$Ô&ð �|�|ˆ| §§ ¨t×/A×/AÐ/AÀT×EW×EWÐEWØ�M‰M× Ñ Ô!2°4Ó!8Ô9Ø×Ñ×$Ñ$ aÔ):¸4Ó)@Ð%AÔBØ×ÑÖñ FX‰|øô &ô EØ×,Ñ,¨T¼3¸s»8×DÓDûðEús   ÃF&Æ&GÆ1GÇGc               ó   € V ^8„  d   QhRR/# r°   r   )r   s   "r   r   r©   t  s   € ÷ Bñ B°Dñ Br   c                	óÐ   € \        V\        4      '       g   Q hV P                  '       d   \        W0P                  W4      h\        R V4       \        RV^,            RV: 24       R# )zWARNING:zWARNING: Problem on line z: N)rÆ   r   r¨   rH   rK   Úprint)rS   r9   rL   ré   s   &&&&r   rÊ   ÚPoFileParser._invalid_pofilet  sV   € Ü˜$¤×$Ò$Ð$Ð$Ø××ÐÜ˜c§<¡<°Ó>Ð>Üˆj˜#ÔÜÐ)¨&°1­*¨°R¸±xÐ@ÖAr   )r¨   r¶   rK   r·   r«   r´   r§   r»   r¹   rº   rB   r²   r¸   r¬   r³   rµ   N)rÍ   rã   rÑ   rå   )FF)F)rV   rW   rX   rY   rZ   ræ   rR   r­   rÒ   r×   rÞ   rÝ   rÜ   rø   r  rÊ   r[   r   r   r   r¥   r¥   ´   sJ   † ñò€I÷$õ õ$õ@ ÷?÷'2õR
õ8õ6 ÷@Bñ Br   r¥   Fc               ó4   € V ^8„  d   QhRRRRRRRRR	RR
RRR/# )r   rû   rü   ÚlocalezLocale | str | NoneÚdomainz
str | Noner§   rs   r  r¨   r   r   r   )r   s   "r   r   r   |  sN   € ÷ 9ñ 9Ø*ð9àð9ð ð9ð ð	9ð
 ð9ð ð9ð ñ9r   c                ó\   € \        WVR7      p\        WcVR7      pVP                  V 4       V# )a  Read messages from a ``gettext`` PO (portable object) file from the given
file-like object (or an iterable of lines) and return a `Catalog`.

>>> from datetime import datetime
>>> from io import StringIO
>>> buf = StringIO('''
... #: main.py:1
... #, fuzzy, python-format
... msgid "foo %(name)s"
... msgstr "quux %(name)s"
...
... # A user comment
... #. An auto comment
... #: main.py:3
... msgid "bar"
... msgid_plural "baz"
... msgstr[0] "bar"
... msgstr[1] "baaz"
... ''')
>>> catalog = read_po(buf)
>>> catalog.revision_date = datetime(2007, 4, 1)

>>> for message in catalog:
...     if message.id:
...         print((message.id, message.string))
...         print(' ', (message.locations, sorted(list(message.flags))))
...         print(' ', (message.user_comments, message.auto_comments))
(u'foo %(name)s', u'quux %(name)s')
  ([(u'main.py', 1)], [u'fuzzy', u'python-format'])
  ([], [])
((u'bar', u'baz'), (u'bar', u'baaz'))
  ([(u'main.py', 3)], [])
  ([u'A user comment'], [u'An auto comment'])

.. versionadded:: 1.0
   Added support for explicit charset argument.

:param fileobj: the file-like object (or iterable of lines) to read the PO file from
:param locale: the locale identifier or `Locale` object, or `None`
               if the catalog is not bound to a locale (which basically
               means it's a template)
:param domain: the message domain
:param ignore_obsolete: whether to ignore obsolete messages in the input
:param charset: the character set of the catalog.
:param abort_invalid: abort read if po file is invalid
)r  r  r  )r¨   )r   r¥   r  )rû   r  r  r§   r  r¨   rK   Úparsers   &&&&&&  r   Úread_por  |  s.   € ôl ˜V¸GÔD€GÜ˜'À-ÔP€FØ
‡L�L�ÔØ€Nr   zL(\s+|[^\s\w]*\w+[a-zA-Z]-(?=\w+[a-zA-Z])|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))c               ó    € V ^8„  d   QhRRRR/# r   r   )r   s   "r   r   r   ¿  s   € ÷ 0ñ 0�3ð 0˜3ñ 0r   c                ó´   € RV P                  RR4      P                  RR4      P                  RR4      P                  RR	4      P                  R
R4      ,          # )zÙEscape the given string so that it can be included in double-quoted
strings in ``PO`` files.

>>> escape('''Say:
...   "hello, world!"
... ''')
'"Say:\\n  \\"hello, world!\\"\\n"'

:param string: the string to escape
z"%s"Ú\z\\r   z\tr!   z\rr   z\nrÛ   z\")Úreplace)r   s   &r   Úescaper  ¿  sN   € ð �F—N‘N 4¨Ó0ß"™7 4¨Ó/ß"™7 4¨Ó/ß"™7 4¨Ó/ß"™7 4¨Ó/õ	0ð 0r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   r   r   ÚprefixÚwidthrM   r   r   )r   s   "r   r   r   Ñ  s.   € ÷ :Kñ :K�cð :K 3ð :K°Cð :KÀñ :Kr   c           
     óÎ  € V'       EdG   V^ 8”  Ed?   \        V4      p. pV P                  R4       EF  p\        \        V4      4      V,           V8”  dæ   \        P	                  V4      pVP                  4        V'       d¶   . p^pV'       dˆ   \        \        VR,          4      4      ^,
          V,           p	W‰,           V8  d*   VP                  VP                  4       4       W‰,          pKg  V'       g    VP                  VP                  4       4        VP                  RP                  V4      4       K½  EK	  VP                  V4       EK  	  MV P                  R4      p\        V4      ^8:  d   \        V 4      # V'       d(   VR,          '       g   VR VR;;,          R,          uu&   RRP                  V Uu. uF  qQ\        V4      ,           NK  	  up4      ,           # u upi )a]  Convert a string into a format that is appropriate for .po files.

>>> print(normalize('''Say:
...   "hello, world!"
... ''', width=None))
""
"Say:\n"
"  \"hello, world!\"\n"

>>> print(normalize('''Say:
...   "Lorem ipsum dolor sit amet, consectetur adipisicing elit, "
... ''', width=32))
""
"Say:\n"
"  \"Lorem ipsum dolor sit "
"amet, consectetur adipisicing"
" elit, \"\n"

:param string: the string to normalize
:param prefix: a string that should be prepended to every line
:param width: the maximum line width; use `None`, 0, or a negative number
              to completely disable line wrapping
Tr0   r   z""
r'   )	rÄ   r1   r  ÚWORD_SEPr?   ÚreverserA   Úpopr4   )
r   r  r  Ú	prefixlenr6   r9   ÚchunksÚbufÚsizeÚlengths
   &&&       r   Ú	normalizer!  Ñ  sj  € ÷0 €u�˜•Ü˜“Kˆ	ØˆØ×%Ñ% d×+ˆDÜ”6˜$“<Ó  9Õ,¨uÔ4Ü!Ÿ™¨Ó-�Ø—‘Ô ßØ�CØ�Dß Ü!$¤V¨F°2­JÓ%7Ó!8¸1Õ!<¸yÕ!H˜Ø�=¨5Ô0ØŸJ™J v§z¡z£|Ô4Ø �NšDç#&ð !$§
¡
¨6¯:©:«<Ô 8Ø!Ø—L‘L §¡¨£Ö.ò ð  —‘˜T×"ò) ,ð, ×!Ñ! $Ó'ˆä
ˆ5ƒz�Q„Ü�f‹~Ð÷ �U˜2—Y”YØ�"ˆIØˆb�	�TÕ‹	Ø�D—I‘IÁ5ÓIÁ5¸4¬°«× 5Ð 5Á5ÑIÓJÕJÐJùÒIs   Æ;G"
c               ó    € V ^8„  d   QhRRRR/# )r   Úfilenamer   r   r   )r   s   "r   r   r     s   € ÷ ñ ¨Sð °Sñ r   c                ó¦   € RV 9  d
   RV 9  d   V # V P                  R4      '       g
   RV ,           p V P                  R4      '       g
   V R,          p V # )zÐEnclose filenames which include white spaces or tabs.

Do the same as gettext and enclose filenames which contain white
spaces or tabs with First Strong Isolate (U+2068) and Pop
Directional Isolate (U+2069).
r=   r   r;   r<   )r2   Úendswith)r#  s   &r   Ú_enclose_filename_if_necessaryr&    sS   € ð �(Ô˜t¨8Ô3Øˆà×Ñ˜x×(Ò(Ø˜hÕ&ˆØ×Ñ˜X×&Ò&Ø�HÕˆØ€Or   Tc               óD   € V ^8„  d   QhRRRRRRRRR	RR
RRRRRRRRRRR/# )r   rû   zSupportsWrite[bytes]rK   r   r  rM   Úno_locationrs   Úomit_headerÚsort_outputÚsort_by_filer§   Úinclude_previousÚinclude_linenor   rN   r   )r   s   "r   r   r     sƒ   € ÷ Jñ JØ!ðJàðJð ðJð ð	Jð
 ðJð ðJð ðJð ðJð ðJð ðJð 
ñJr   c
                óî   € Rp
V'       d   Rp
M
V'       d   Rp
\        VVV	VVVV
VR7       FF  p\        V\        4      '       d   VP                  VP                  R4      pV P                  V4       KH  	  R# )a-  Write a ``gettext`` PO (portable object) template file for a given
message catalog to the provided file-like object.

>>> catalog = Catalog()
>>> catalog.add(u'foo %(name)s', locations=[('main.py', 1)],
...             flags=('fuzzy',))
<Message...>
>>> catalog.add((u'bar', u'baz'), locations=[('main.py', 3)])
<Message...>
>>> from io import BytesIO
>>> buf = BytesIO()
>>> write_po(buf, catalog, omit_header=True)
>>> print(buf.getvalue().decode("utf8"))
#: main.py:1
#, fuzzy, python-format
msgid "foo %(name)s"
msgstr ""
<BLANKLINE>
#: main.py:3
msgid "bar"
msgid_plural "baz"
msgstr[0] ""
msgstr[1] ""
<BLANKLINE>
<BLANKLINE>

:param fileobj: the file-like object to write to
:param catalog: the `Catalog` instance
:param width: the maximum line width for the generated output; use `None`,
              0, or a negative number to completely disable line wrapping
:param no_location: do not emit a location comment for every message
:param omit_header: do not include the ``msgid ""`` entry at the top of the
                    output
:param sort_output: whether to sort the messages in the output by msgid
:param sort_by_file: whether to sort the messages in the output by their
                     locations
:param ignore_obsolete: whether to ignore obsolete messages and not include
                        them in the output; by default they are included as
                        comments
:param include_previous: include the old msgid as a comment when
                         updating the catalog
:param include_lineno: include line number in the location comment
NrJ   rC   )r§   r-  r,  r(  r)  Úsort_byr  Úbackslashreplace)Úgenerate_porÆ   r   Úencoder  Úwrite)rû   rK   r  r(  r)  r*  r+  r§   r,  r-  r/  r9   s   &&&&&&&&&&  r   Úwrite_por4    sq   € ðp €GßØ‰ß	ØˆäØØ'Ø%Ø)ØØØØ÷	ˆô �dœC× Ò Ø—;‘;˜wŸ™Ð0BÓCˆDØ�‰�dÖó	r   r§   r-  r,  r(  r)  r/  r  c               ó<   € V ^8„  d   QhRRRRRRRRRRRRR	R
RRRR/	# )r   rK   r   r§   rs   r-  r,  r(  r)  r/  ú%Literal['message', 'location'] | Noner  rM   r   zIterable[str]r   )r   s   "r   r   r   l  so   € ÷ jñ jØðjð ðjð ð	jð
 ðjð ðjð ðjð 3ðjð ðjð ñjr   c          	   #  ó¾  a aa"  € S'       d
   S^ 8”  d   SM^Lp\        VRR7      o\        SRRR7      p	RV3R llp
RV V3R llp\        S VR7       EFc  pVP                  '       gn   V'       d   K   S P                  pS'       dI   S^ 8”  dB   . pVP	                  4        F  pWéP                  V4      ,          pK  	  R	P                  V4      pV R	2x € VP                   F  pV
! V4       R
j  x€L
  K  	  VP                   F  pV
! VRR7       R
j  x€L
  K  	  V'       g¦   . p \        VP                  R R7      pV Fc  w  ppVP                  \        P                  R4      p\        V4      pV'       d   V'       d	   V RVR 2pVV9  g   KR  VP!                  V4       Ke  	  V
! RP                  V4      RR7       R
j  x€L
  VP"                  '       d.   RRP                  R.\        VP"                  4      O4       R	2x € VP$                  '       d‡   V'       d   V
! R\'        VP$                  ^ ,          SR7       2RR7       R
j  x€L
  \)        VP$                  4      ^8”  d4   \'        VP$                  ^,          SR7      pV
! RV 2RR7       R
j  x€L
  V! V4       R
j  x€L
  R	x € EKf  	  V'       gh   \        S P*                  P-                  4       VR7       F<  pVP                   F  pV
! V4       R
j  x€L
  K  	  V! VRR7       R
j  x€L
  R	x € K>  	  R
# R
#  EL< EL  \         d    TP                  p ELi ; i ELŠ EL L¸ Lª LT L@5i)z|Yield text strings representing a ``gettext`` PO (portable object) file.

See `write_po()` for a more detailed description.
F)r  Úbreak_long_wordsz# )r  Úsubsequent_indentr8  r0   c              3  ór   <"  € SP                  V 4       F  pR V RVP                  4        R2x € K  	  R# 5i)rþ   r=   r   N)Úwraprj   )r÷   r  r9   Úcomment_wrappers   && €r   Ú_format_commentÚ$generate_po.<locals>._format_comment‚  s6   øé € Ø#×(Ñ(¨Ö1ˆDØ�f�X˜Q˜tŸz™z›|˜n¨BÐ/Ô/ó 2ùs   ƒ47c              3  ó  <"  € \        V P                  \        \        34      '       dÌ   V P                  '       d!   V R \        V P                  VSR7       R2x € V R\        V P                  ^ ,          VSR7       R2x € V R\        V P                  ^,          VSR7       R2x € \        SP                  4       F0  p V P                  V,          pV RVR R\        W1SR7       R2x € K2  	  R
# V P                  '       d!   V R \        V P                  VSR7       R2x € V R\        V P                  VSR7       R2x € T R	\        V P                  ;'       g    RVSR7       R2x € R
#   \         d    Rp L¬i ; i5i)zmsgctxt )r  r  r   úmsgid úmsgid_plural r0   zmsgstr[Údz] zmsgstr N)
rÆ   ÚidrÇ   rÅ   r·   r!  rÈ   rÉ   r   rç   )rJ   r  rÏ   r   rK   r  s   &&  €€r   Ú_format_messageÚ$generate_po.<locals>._format_message†  st  øé € Ü�g—j‘j¤4¬ -×0Ò0Ø��ˆØ˜ ¬°7·?±?È6ÐY^Ô)_Ð(`Ð`bÐcÒcØ�H˜F¤9¨W¯Z©Z¸­]À6ÐQVÔ#WÐ"XÐXZÐ[Ò[Ø�H˜M¬)°G·J±J¸qµMÈ&ÐX]Ô*^Ð)_Ð_aÐbÒbä˜W×0Ñ0Ö1�ð Ø$Ÿ^™^¨CÕ0�Fð  ˜ ¨¨A w¨b´¸6ÐX]Ô1^Ð0_Ð_aÐbÔbó 2ð ��ˆØ˜ ¬°7·?±?È6ÐY^Ô)_Ð(`Ð`bÐcÒcØ�H˜F¤9¨W¯Z©ZÀÈeÔ#TÐ"UÐUWÐXÒXØ�H˜G¤I¨g¯n©n×.BÐ.BÀÈ6ÐY^Ô$_Ð#`Ð`bÐcÔcøô "ô  Ø’Fð üs<   ƒ8F¼BFÃE3Ã0FÄAFÅ"FÅ3FÆ FÆFÆF)r/  r   Nró   )r  c                óx   € V ^ ,          \        V ^,          \        4      ;'       d    V ^,          ;'       g    R3# )r‰   r'   )rÆ   rM   )Úxs   &r   Ú<lambda>Úgenerate_po.<locals>.<lambda>³  s0   € °!°Aµ$¼
À1ÀQÅ4ÌÓ8M×8VÐ8VÐRSÐTUÕRV×8\Ð8\ÐZ\Ñ1]r   ©ÚkeyÚ/rð   rB  r=   rþ   z, r@  )r  Ú|rA  z#~ ro   )r	   Ú_sort_messagesrC  Úheader_commentr1   r;  r4   rµ   r¶   ÚsortedrB   Ú	TypeErrorr  ry   Úsepr&  rA   r´   Úprevious_idr!  rÄ   r¸   Úvalues)rK   r§   r-  r,  r(  r)  r/  r  Úcomment_widthÚheader_wrapperr=  rD  rJ   Úcomment_headerr6   r9   r÷   ÚlocsrB   r#  rL   rC   Únorm_previous_idr<  s   f$$$$$$d               @r   r1  r1  l  s  úé € ÷" # u¨q¤y‘E°b€Mä!¨ÈÔN€OÜ  uÀÐW\Ô]€N÷0÷dð dô& " '°7×;Ð;ˆØ�z�zˆzßÙØ$×3Ñ3ˆNß˜ œØ�Ø*×5Ñ5Ö7�DØ×0Ñ0°Ó6Õ6’Eñ 8à!%§¡¨5Ó!1�Ø#Ð$ BÐ'Ò'à×,Ô,ˆGÙ& wÓ/×/Ò/ñ -à×,Ô,ˆGÙ& w°sÔ;×;Ò;ñ -÷ ØˆDð.Ü" 7×#4Ñ#4Ù']ô_�	ó
 %.Ñ �˜&Ø#×+Ñ+¬B¯F©F°CÓ8�Ü9¸(ÓC�ßŸnØ"* ¨1¨V°A¨JÐ7�HØ 4Ö'Ø—K‘K Ö)ñ %.ñ ' s§x¡x°£~¸cÔB×BÐBØ�=�=ˆ=Ø�d—i‘i Ð <¤f¨W¯]©]Ó&;Ð <Ó=Ð>¸bÐAÒAà××Ð×#3Ù&Øœ 7×#6Ñ#6°qÕ#9ÀÔGÐHÐIØô÷ ð ô �7×&Ñ&Ó'¨!Ô+Ü#,¨W×-@Ñ-@ÀÕ-CÈ5Ô#QÐ Ù*¨]Ð;KÐ:LÐ+MÐVYÔZ×ZÐZá" 7Ó+×+Ð+Ø�
ñg <÷j Ü%Ø×Ñ×#Ñ#Ó%Ø÷
ˆGð #×0Ô0�Ù*¨7Ó3×3Ò3ñ 1á& w°uÔ=×=Ð=ØŒJó
ñ òQ 0â;øô ô .Ø#×-Ñ-“	ð.úò Cò
ñ [á+ñ 4Ù=ùsè   …A*MÁ0MÂA)MÃ/L+Ã0$MÄL.ÄMÄ%MÄ(L1Å AMÆMÆ1MÇMÇMÇ>MÈMÈ#,MÉMÉAMÊMÊMÊ,MÊ-MËAMÌMÌMÌMÌMÌ.MÌ1MÍMÍMÍMÍMÍMÍMÍMÍMc               ó$   € V ^8„  d   QhRRRRRR/# )r   r²   zIterable[Message]r/  r6  r   zlist[Message]r   )r   s   "r   r   r   Ù  s$   € ÷ ñ Ð.ð Ð9^ð Ðcpñ r   c                ó‚   € \        V 4      p VR8X  d   V P                  4        V # VR8X  d   V P                  R R7       V # )zà
Sort the given message iterable by the given criteria.

Always returns a list.

:param messages: An iterable of Messages.
:param sort_by: Sort by which criteria? Options are `message` and `location`.
:return: list[Message]
rJ   rC   c                ó   € V P                   # rc   )rB   )r$   s   &r   rH  Ú _sort_messages.<locals>.<lambda>ç  s   €  A§K¢Kr   rJ  )rÇ   rÃ   )r²   r/  s   &&r   rN  rN  Ù  sC   € ô �H‹~€HØ�)ÔØ�‰Œð €Oð 
�JÔ	Ø�‰Ñ/ˆÔ0Ø€Or   )NNFNF)r0   éL   )r^  FFFFFFT)&rZ   Ú
__future__r   ry   r(   Úcollections.abcr   Útypingr   r   Ú
babel.corer   Úbabel.messages.catalogr   r   Ú
babel.utilr	   r
   r   r   Ú	_typeshedr   r+   r7   rF   Ú	ExceptionrH   r^   r¥   r  r)   r  r  r!  r&  r4  r1  rN  r   r   r   Ú<module>rg     sð   ðñ	õ #ã 	Û 	Ý $ß )å ß 3ß (çß!å'õJõ. õ>)ôX�)ô ÷)(ñ )(÷XEBñ EB÷P9ðx �:Š:ð ó €õ0÷$:Kõz÷"JðZjð "ðjð  ð	jð
 #ðjð ðjð ðjð 6:ðjð ÷j÷Zr   