+
    Z‹i­K  ã                  ó  € R t ^ RIHt ^RIHt ^RIHt ^RIHt ^RI	H
t
 ^RIHt ^RIHt ^ RIHt ^ R	It^ R	It^ R	IHu Ht ]P*                  R
,           ]P,                  ,           t]P*                  R,           ]P,                  ,           t]P2                  ! R4      t]P2                  ! R4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]
4      t ! R R]
4      t  ! R R]
4      t! ! R R]4      t"R t#R	# )zŠ
Adds footnote handling to Python-Markdown.

See the [documentation](https://Python-Markdown.github.io/extensions/footnotes)
for details.
)Úannotations)Ú	Extension)ÚBlockProcessor)ÚInlineProcessor)ÚTreeprocessor)ÚPostprocessor)Úutil)ÚOrderedDictNÚzz1337820767766393qqÚqq3936677670287331zzz(fnref)(\d+)z(?<!!)\[\^([^\]]*)\](?!\s*:)c                  ó¦   a € ] tR t^'tRtV 3R ltR tR R 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 R ltRR R lltR R ltRtV ;t# )ÚFootnoteExtensionzFootnote Extension. c                ó,  <€ RRR.RRR.RRR	.R
RR.RRR.RRR.RRR./V n          \        SV `  ! R/ VB  ^ V n        / V n        \        4       V n        V P                  RV P                  R4      P                  RR4      4       V P                  4        R# )zSetup configs. ÚPLACE_MARKERz///Footnotes Go Here///z1The text string that marks where the footnotes goÚ
UNIQUE_IDSFz9Avoid name collisions across multiple calls to `reset()`.ÚBACKLINK_TEXTz&#8617;zCThe text string that links from the footnote to the reader's place.ÚSUPERSCRIPT_TEXTz{}zCThe text string that links from the reader's place to the footnote.ÚBACKLINK_TITLEz$Jump back to footnote %d in the textznThe text string used for the title HTML attribute of the backlink. %d will be replaced by the footnote number.Ú	SEPARATORÚ:zFootnote separator.ÚUSE_DEFINITION_ORDERTz]Order footnote labels by definition order (True) or by document order (False). Default: True.z%dN© )ÚconfigÚsuperÚ__init__Úunique_prefixÚ
found_refsÚsetÚ	used_refsÚ	setConfigÚ	getConfigÚreplaceÚreset)ÚselfÚkwargsÚ	__class__s   &,€Ú?/usr/lib/python3/dist-packages/markdown/extensions/footnotes.pyr   ÚFootnoteExtension.__init__*   sâ   ø€ ð Ø)Ð+^ðð ØÐRðð ØÐ`ðð ØÐ[ð!ð Ø6ð>ðð
 ØÐ*ðð #Øð!ð%ð+
ˆŒð6 	/Ü‰ÒÑ"˜6Ò"ð ˆÔØ*,ˆŒÜ#&£5ˆŒð 	�‰Ð'¨¯©Ð8HÓ)I×)QÑ)QÐRVÐX\Ó)]Ô^à�
‰
Žó    c                ód  € VP                  V 4       VP                  V n        Wn        VP                  P                  P	                  \        V 4      R^4       RpVP                  P	                  \        W 4      R^¯4       VP                  P	                  \        V 4      R^24       V P                  R4      '       g'   VP                  P	                  \        V 4      R^4       VP                  P	                  \        V 4      R^4       VP                  P	                  \        V 4      R^4       R# )zAdd pieces to Markdown. Úfootnotez\[\^([^\]]*)\]r   zfootnote-reorderzfootnote-duplicateN)ÚregisterExtensionÚparserÚmdÚblockprocessorsÚregisterÚFootnoteBlockProcessorÚinlinePatternsÚFootnoteInlineProcessorÚtreeprocessorsÚFootnoteTreeprocessorr    ÚFootnoteReorderingProcessorÚFootnotePostTreeprocessorÚpostprocessorsÚFootnotePostprocessor)r#   r-   ÚFOOTNOTE_REs   && r&   ÚextendMarkdownÚ FootnoteExtension.extendMarkdownU   sý   € à
×Ñ˜TÔ"Ø—i‘iˆŒØŒà
�	‰	×!Ñ!×*Ñ*Ô+AÀ$Ó+GÈÐUWÔXð (ˆØ
×Ñ×"Ñ"Ô#:¸;Ó#MÈzÐ[^Ô_ð 	×Ñ×"Ñ"Ô#8¸Ó#>À
ÈBÔOð
 �~‰~Ð4×5Ò5Ø×Ñ×&Ñ&Ô'BÀ4Ó'HÐJ\Ð^`Ôað 	×Ñ×"Ñ"Ô#<¸TÓ#BÐDXÐZ\Ô]ð 	×Ñ×"Ñ"Ô#8¸Ó#>À
ÈBÖOr(   c               ó   € V ^8„  d   QhRR/# )é   ÚreturnÚNoner   )Úformats   "r&   Ú__annotate__ÚFootnoteExtension.__annotate__t   s   € ÷ ñ �tñ r(   c                ó�   € . V n         \        4       V n        V ;P                  ^,          un        / V n        \        4       V n        R# )z=Clear footnotes on reset, and prepare for distinct document. N)Úfootnote_orderr	   Ú	footnotesr   r   r   r   ©r#   s   &r&   r"   ÚFootnoteExtension.resett   s4   € à)+ˆÔÜ0;³ˆŒØ×Ò˜aÕÕØˆŒÜ›ˆŽr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r=   Ú	referenceÚstrÚfoundÚboolr>   r   )r@   s   "r&   rA   rB   |   s!   € ÷ ñ  Cð °ð Àñ r(   c                óB  € V'       g   V# TpWP                   9   d¨   VP                  V P                  4       ^4      w  rE\        P	                  V4      pV'       dL   RVP                  ^4      \        VP                  ^4      4      ^,           V P                  4       V3,          pKš  RV^V P                  4       V3,          pK·  V P                   P                  V4       W0P                  9   d"   V P                  V;;,          ^,          uu&   V# ^V P                  V&   V# )z0Get a unique reference if there are duplicates. ú%s%d%s%s)	r   ÚsplitÚget_separatorÚ	RE_REF_IDÚmatchÚgroupÚintÚaddr   )r#   rI   rK   Úoriginal_refÚrefÚrestÚms   &&&    r&   Ú
unique_refÚFootnoteExtension.unique_ref|   sæ   € çØÐà ˆØŸ>™>Ô)Ø!Ÿ™¨×(:Ñ(:Ó(<¸aÓ@‰IˆCÜ—‘ Ó$ˆAßØ&¨!¯'©'°!«*´c¸!¿'¹'À!»*³oÀaÕ6GÈ×I[ÑI[ÓI]Ð_cÐ)dÕd’	à&¨#¨q°$×2DÑ2DÓ2FÈÐ)MÕM’	à�‰×Ñ˜9Ô%ØŸ?™?Ô*Ø�O‰O˜L×)¨QÕ.Ó)ð Ðð -.ˆD�O‰O˜LÑ)ØÐr(   c               ó    € V ^8„  d   QhRRRR/# )r=   Úrootúetree.Elementr>   z0tuple[etree.Element, etree.Element, bool] | Noner   )r@   s   "r&   rA   rB   ‘   s   € ÷ ñ Ø!ðà	9ñr(   c                ó(   a a€ VV 3R loS! V4      pV# )z?Return ElementTree Element that contains Footnote placeholder. c                óV  <€ V  F¡  pVP                   '       d6   VP                   P                  SP                  R 4      4      R8”  d   WR3u # VP                  '       d6   VP                  P                  SP                  R 4      4      R8”  d   WR3u # S! V4      pVf   KŸ  Vu # 	  R# )r   TFNéÿÿÿÿ)ÚtextÚfindr    Útail)ÚelementÚchildÚ	child_resÚfinderr#   s   &  €€r&   rh   Ú:FootnoteExtension.findFootnotesPlaceholder.<locals>.finder•   s‹   ø€ Û �Ø—:—:�:Ø—z‘z—‘ t§~¡~°nÓ'EÓFÈÔKØ$¨tÐ3Ò3Ø—:—:�:Ø—z‘z—‘ t§~¡~°nÓ'EÓFÈÔKØ$¨uÐ4Ò4Ù" 5›M�	ØÔ(Ø$Ò$ñ !ñ r(   r   )r#   r]   Úresrh   s   f& @r&   ÚfindFootnotesPlaceholderÚ*FootnoteExtension.findFootnotesPlaceholder‘   s   ù€ ö	ñ �T‹lˆØˆ
r(   c               ó$   € V ^8„  d   QhRRRRRR/# )r=   ÚidrJ   rb   r>   r?   r   )r@   s   "r&   rA   rB   ¥   s!   € ÷ "ñ "˜cð "¨ð "°ñ "r(   c                ó"   € W P                   V&   R# )z&Store a footnote for later retrieval. N©rE   )r#   rn   rb   s   &&&r&   ÚsetFootnoteÚFootnoteExtension.setFootnote¥   s   € à!�‰�rÓr(   c               ó    € V ^8„  d   QhRRRR/# )r=   rn   rJ   r>   r?   r   )r@   s   "r&   rA   rB   ©   s   € ÷ +ñ + ð +¨ñ +r(   c                ó`   € WP                   9  d   V P                   P                  V4       R# R# )z6Store a footnote reference id in order of appearance. N)rD   Úappend©r#   rn   s   &&r&   ÚaddFootnoteRefÚ FootnoteExtension.addFootnoteRef©   s'   € à×(Ñ(Ô(Ø×Ñ×&Ñ& rÖ*ñ )r(   c               ó   € V ^8„  d   QhRR/# )r=   r>   rJ   r   )r@   s   "r&   rA   rB   ®   s   € ÷ +ñ +˜sñ +r(   c                ó$   € V P                  R4      # )zGet the footnote separator. r   )r    rF   s   &r&   rP   ÚFootnoteExtension.get_separator®   s   € à�~‰~˜kÓ*Ð*r(   c               ó    € V ^8„  d   QhRRRR/# )r=   rn   rJ   r>   r   )r@   s   "r&   rA   rB   ²   s   € ÷ =ñ = ð =¨ñ =r(   c                ó¸   € V P                  R4      '       d%   RV P                  4       V P                  V3,          # RP                  V P                  4       V4      # )zReturn footnote link id. r   z	fn%s%d-%szfn{}{})r    rP   r   r@   rv   s   &&r&   ÚmakeFootnoteIdÚ FootnoteExtension.makeFootnoteId²   sL   € à�>‰>˜,×'Ò'Ø $×"4Ñ"4Ó"6¸×8JÑ8JÈBÐ!OÕOÐOà—?‘? 4×#5Ñ#5Ó#7¸Ó<Ð<r(   c               ó$   € V ^8„  d   QhRRRRRR/# )r=   rn   rJ   rK   rL   r>   r   )r@   s   "r&   rA   rB   ¹   s&   € ÷ Xñ X Cð X°ð XÀñ Xr(   c                óø   € V P                  R4      '       d5   V P                  RV P                  4       V P                  V3,          V4      # V P                  RP	                  V P                  4       V4      V4      # )zReturn footnote back-link id. r   zfnref%s%d-%sz	fnref{}{})r    rZ   rP   r   r@   )r#   rn   rK   s   &&&r&   ÚmakeFootnoteRefIdÚ#FootnoteExtension.makeFootnoteRefId¹   sg   € à�>‰>˜,×'Ò'Ø—?‘? >°T×5GÑ5GÓ5IÈ4×K]ÑK]Ð_aÐ4bÕ#bÐdiÓjÐjà—?‘? ;×#5Ñ#5°d×6HÑ6HÓ6JÈBÓ#OÐQVÓWÐWr(   c               ó    € V ^8„  d   QhRRRR/# )r=   r]   r^   r>   zetree.Element | Noner   )r@   s   "r&   rA   rB   À   s   € ÷ 'ñ ' ]ð 'Ð7Kñ 'r(   c                óæ  € \        V P                  P                  4       4      '       g   R# \        P                  ! R4      pVP                  RR4       \        P                  ! VR4       \        P                  ! VR4      p\        P                  ! R4      p\        V P                  P                  4       ^R7       EF¯  w  rV\        P                  ! VR4      pVP                  R	V P                  V4      4       V P                  P                  W@P                  V,          4       \        V4       F%  pVP                  V4       VP                  V4       K'  	  \        P                  ! R
4      p	V	P                  RRV P                  V4      ,           4       V	P                  RR4       V	P                  RV P                  R4      P                  V4      4       \         V	n        \%        V4      '       g   EK=  VR,          p
V
P&                  R8X  d1   V
P"                  \(        ,           V
n        V
P                  V	4       EK‡  \        P                  ! VR4      pVP                  V	4       EK²  	  V# )z.Return `div` of footnotes as `etree` Element. NÚdivÚclassr*   ÚhrÚol©ÚstartÚlirn   ÚaÚhrefÚ#úfootnote-backrefÚtitler   Úpra   )ÚlistrE   ÚkeysÚetreeÚElementr   Ú
SubElementÚ	enumerater~   r,   Ú
parseChunkru   Úremover‚   r    r@   ÚFN_BACKLINK_TEXTrb   ÚlenÚtagÚNBSP_PLACEHOLDER)r#   r]   r†   r‰   Úsurrogate_parentÚindexrn   rŒ   ÚelÚbacklinkÚnoder’   s   &&          r&   ÚmakeFootnotesDivÚ"FootnoteExtension.makeFootnotesDivÀ   sÎ  € ô �D—N‘N×'Ñ'Ó)×*Ò*Ùä�mŠm˜EÓ"ˆØ�‰�˜Ô$Ü×Ò˜˜dÔ#Ü×Ò˜c 4Ó(ˆÜ Ÿ=š=¨Ó/Ðä" 4§>¡>×#6Ñ#6Ó#8À×BÐB‰IˆEÜ×!Ò! " dÓ+ˆBØ�F‰F�4˜×,Ñ,¨RÓ0Ô1ð �K‰K×"Ñ"Ð#3·^±^ÀBÕ5GÔHÜÐ+Ö,�Ø—	‘	˜"”Ø ×'Ñ'¨Ö+ñ -ô —}’} SÓ)ˆHØ�L‰L˜  t×'=Ñ'=¸bÓ'AÕ!AÔBØ�L‰L˜Ð"4Ô5Ø�L‰LØØ—‘Ð/Ó0×7Ñ7¸Ó>ôô -ˆHŒMä�2�w�wØ˜"•v�Ø—8‘8˜s”?Ø $§	¡	Ô,<Õ <�D”IØ—K‘K ×)ä×(Ò(¨¨SÓ1�AØ—H‘H˜X×&ñ5 Cð6 ˆ
r(   )r   rD   rE   r   r-   r,   r   r   )F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r:   r"   rZ   rk   rq   rw   rP   r~   r‚   r¤   Ú__static_attributes__Ú__classcell__©r%   s   @r&   r   r   '   sE   ø† Ùõ)òVPõ>÷õ*õ("õ+õ
+õ=÷X÷'ó 'r(   r   c                  óœ   a € ] tR t^êtRt]P                  ! R]P                  4      tR V 3R llt	R R lt
R R ltR	 R
 ltR R ltRtV ;t# )r0   z3Find footnote definitions and store for later use. z!^[ ]{0,3}\[\^([^\]]*)\]:[ ]*(.*)$c               ó   € V ^8„  d   QhRR/# ©r=   rE   r   r   )r@   s   "r&   rA   Ú#FootnoteBlockProcessor.__annotate__ï   s   € ÷ #ñ #Ð"3ñ #r(   c                	óF   <€ \         SV `  VP                  4       Wn        R # ©N)r   r   r,   rE   )r#   rE   r%   s   &&€r&   r   ÚFootnoteBlockProcessor.__init__ï   s   ø€ Ü‰Ñ˜×)Ñ)Ô*Ø"Žr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r=   Úparentr^   ÚblockrJ   r>   rL   r   )r@   s   "r&   rA   r±   ó   s!   € ÷ ñ ˜=ð °ð ¸ñ r(   c                	ó   € R # )Tr   )r#   r¶   r·   s   &&&r&   ÚtestÚFootnoteBlockProcessor.testó   s   € Ùr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r=   r¶   r^   Úblocksú	list[str]r>   rL   r   )r@   s   "r&   rA   r±   ö   s!   € ÷ #ñ #˜-ð #°ð #¸tñ #r(   c                óB  € VP                  ^ 4      pV P                  P                  V4      pV'       EdØ   VP                  ^4      pVP                  ^4      .pW4P	                  4       R P                  R4      pV P                  P                  V4      pV'       d�   VRVP                  4        P                  R4      p	RP                  V^ ,          V P                  V	4      .4      P                  R4      V^ &   VP                  ^ WxP                  4       R 4       M[RP                  V^ ,          V P                  V4      .4      P                  R4      V^ &   VP                  V P                  V4      4       RP                  V4      p
V P                  P                  WZP                  4       4       VRVP                  4        P                  4       '       d3   VP                  ^ VRVP                  4        P                  R4      4       R# VP                  ^ V4       R# )z,Find, set, and remove footnote definitions. NÚ
z

TF)ÚpopÚREÚsearchrS   ÚendÚlstripr‹   ÚrstripÚjoinÚdetabÚinsertÚstripÚextendÚdetectTabbedrE   rq   )r#   r¶   r¼   r·   rY   rn   Ú	fn_blocksÚtherestÚm2Úbeforer*   s   &&&        r&   ÚrunÚFootnoteBlockProcessor.runö   s¥  € à—
‘
˜1“ˆà�G‰G�N‰N˜5Ó!ˆßˆ1Ø—‘˜“ˆBØŸ™ ›˜ˆIð ŸE™E›G˜H�o×,Ñ,¨TÓ2ˆGØ—‘—‘ Ó(ˆBßð !  "§(¡(£*Ð-×4Ñ4°TÓ:�Ø#Ÿy™y¨)°A­,¸¿
¹
À6Ó8JÐ)KÓL×SÑSÐTXÓY�	˜!‘à—‘˜a ¯©«¨Ð!5Õ6ð  $Ÿy™y¨)°A­,¸¿
¹
À7Ó8KÐ)LÓM×SÑSÐTXÓY�	˜!‘ð × Ñ  ×!2Ñ!2°6Ó!:Ô;à—{‘{ 9Ó-ˆHØ�N‰N×&Ñ& r¯?©?Ó+<Ô=à�Z�a—g‘g“iÐ ×&Ñ&×(Ò(à—‘˜a  z¨¯©«	Ð!2×!9Ñ!9¸$Ó!?Ô@Ùà�‰�a˜ÔÙr(   c               ó    € V ^8„  d   QhRRRR/# )r=   r¼   r½   r>   r   )r@   s   "r&   rA   r±     s   € ÷ ñ  9ð °ñ r(   c                óÖ  € . pV'       dß   V^ ,          P                  R4      '       d¾   VP                  ^ 4      pV P                  P                  V4      pV'       dh   VRVP	                  4        P                  R4      pVP                  V P                  V4      4       VP                  ^ W4P	                  4       R 4        V# VP                  V P                  V4      4       Kã   V# V# )zyFind indented text and remove indent before further processing.

Returns:
    A list of blocks with indentation removed.
Nr¿   ú    )	Ú
startswithrÀ   rÁ   rÂ   r‹   rÅ   ru   rÇ   rÈ   )r#   r¼   rÌ   r·   rY   rÏ   s   &&    r&   rË   Ú#FootnoteBlockProcessor.detectTabbed  sÆ   € ð ˆ	ßØ�a�y×#Ñ# E×*Ò*ØŸ
™
 1›�à—G‘G—N‘N 5Ó)�ßð # : A§G¡G£IÐ.×5Ñ5°dÓ;�FØ×$Ñ$ T§Z¡Z°Ó%7Ô8à—M‘M ! U¯7©7«9¨:Ð%6Ô7àð Ðð	 ×$Ñ$ T§Z¡Z°Ó%6Ö7ð ØÐˆyÐr(   c               ó    € V ^8„  d   QhRRRR/# )r=   r·   rJ   r>   r   )r@   s   "r&   rA   r±   8  s   € ÷ 	 ñ 	 ˜3ð 	  3ñ 	 r(   c                ó¶   € VP                  R4      p\        V4       F)  w  r4VP                  R4      '       g   K  VR,          W#&   K+  	  RP                  V4      # )zwRemove one level of indent from a block.

Preserve lazily indented blocks by only removing indent from indented lines.
r¿   :é   NNrÔ   )rO   r˜   rÕ   rÆ   )r#   r·   ÚlinesÚiÚlines   &&   r&   rÇ   ÚFootnoteBlockProcessor.detab8  sN   € ð
 —‘˜DÓ!ˆÜ  Ö'‰GˆAØ�‰˜u×%Ô%Ø �8�“ñ (ð �y‰y˜ÓÐr(   rp   )r¦   r§   r¨   r©   rª   ÚreÚcompileÚ	MULTILINErÁ   r   r¹   rÐ   rË   rÇ   r«   r¬   r­   s   @r&   r0   r0   ê   s?   ø† Ù>à	�ŠÐ8¸"¿,¹,Ó	G€B÷#ð #õõ#õJ÷:	 ó 	 r(   r0   c                  ó>   a € ] tR tRtRtR V 3R lltR R ltRtV ;t# )r2   iD  zB`InlineProcessor` for footnote markers in a document's body text. c               ó    € V ^8„  d   QhRRRR/# )r=   ÚpatternrJ   rE   r   r   )r@   s   "r&   rA   Ú$FootnoteInlineProcessor.__annotate__G  s   € ÷ #ñ # ð #Ð0Añ #r(   c                	ó2   <€ \         SV `  V4       W n        R # r³   )r   r   rE   )r#   rã   rE   r%   s   &&&€r&   r   Ú FootnoteInlineProcessor.__init__G  s   ø€ Ü‰Ñ˜Ô!Ø"Žr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r=   rY   zre.Match[str]ÚdatarJ   r>   z3tuple[etree.Element | None, int | None, int | None]r   )r@   s   "r&   rA   rä   K  s"   € ÷ $ñ $˜]ð $°#ð $Ð:mñ $r(   c                	ó°  € VP                  ^4      pW0P                  P                  P                  4       9   Edœ   V P                  P                  V4       V P                  P	                  R4      '       g.   V P                  P
                  P                  V4      ^,           pMC\        V P                  P                  P                  4       4      P                  V4      ^,           p\        P                  ! R4      p\        P                  ! VR4      pVP                  RV P                  P                  VRR7      4       VP                  RRV P                  P                  V4      ,           4       VP                  R	R
4       V P                  P	                  R4      P                  V4      Vn        WQP!                  ^ 4      VP#                  ^ 4      3# R# )é   r   Úsupr�   rn   T)rK   rŽ   r�   r‡   zfootnote-refr   )NNN)rS   rE   r”   rw   r    rD   r    r“   r•   r–   r—   r   r‚   r~   r@   rb   r‹   rÃ   )r#   rY   rè   rn   Úfootnote_numrë   r�   s   &&&    r&   ÚhandleMatchÚ#FootnoteInlineProcessor.handleMatchK  sT  € Ø�W‰W�Q‹ZˆØ—‘×)Ñ)×.Ñ.Ó0Õ0Ø�N‰N×)Ñ)¨"Ô-à—>‘>×+Ñ+Ð,B×CÒCà#Ÿ~™~×<Ñ<×BÑBÀ2ÓFÈÕJ‘ô  $ D§N¡N×$<Ñ$<×$AÑ$AÓ$CÓD×JÑJÈ2ÓNÐQRÕR�ä—-’- Ó&ˆCÜ× Ò   cÓ*ˆAØ�G‰G�D˜$Ÿ.™.×:Ñ:¸2ÀTÐ:ÓJÔKØ�E‰E�&˜# §¡× =Ñ =¸bÓ AÕAÔBØ�E‰E�'˜>Ô*Ø—^‘^×-Ñ-Ð.@ÓA×HÑHÈÓVˆAŒFØŸ™ ›
 A§E¡E¨!£HÐ,Ð,à#Ð#r(   rp   )	r¦   r§   r¨   r©   rª   r   rí   r«   r¬   r­   s   @r&   r2   r2   D  s   ø† ÙM÷#ð #÷$ó $r(   r2   c                  óV   € ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	Rt
R# )r6   ib  z$Amend footnote div with duplicates. c               ó   € V ^8„  d   QhRR/# r°   r   )r@   s   "r&   rA   Ú&FootnotePostTreeprocessor.__annotate__e  ó   € ÷ #ñ #Ð"3ñ #r(   c                	ó   € Wn         R # r³   rp   ©r#   rE   s   &&r&   r   Ú"FootnotePostTreeprocessor.__init__e  ó   € Ø"Žr(   c               ó$   € V ^8„  d   QhRRRRRR/# )r=   rŒ   r^   Ú
duplicatesrT   r>   r?   r   )r@   s   "r&   rA   rñ   h  s!   € ÷ ñ  ð ¸Cð ÀDñ r(   c                ól  € VP                  R4       EF  pVP                  P                  RR4      R8X  g   K'  VP                  R,          P                  V P                  P                  4       ^4      w  rE. p\        ^V^,           4       Ft  p\        P                  ! V4      pRWGV P                  P                  4       V3,          VP                  R&   VP                  V4       V ;P                  ^,          un
        Kv  	  \        V4      R,          p	V F  pV	P                  V4       K  	   R# 	  R# )	zEAdjust current `li` and add the duplicates: `fnref2`, `fnref3`, etc. r�   r‡   Ú r�   rŽ   rN   Nra   )ÚiterÚattribÚgetrO   rE   rP   ÚrangeÚcopyÚdeepcopyru   Úoffsetr“   )
r#   rŒ   rø   ÚlinkrW   rX   Úlinksr    Úsib_linkr¡   s
   &&&       r&   Úadd_duplicatesÚ(FootnotePostTreeprocessor.add_duplicatesh  sê   € à—G‘G˜C—LˆDà�{‰{�‰˜w¨Ó+Ð/AÖAØ ŸK™K¨Õ/×5Ñ5°d·n±n×6RÑ6RÓ6TÐVWÓX‘	�ð �Ü" 1 j°1¥nÖ5�EÜ#Ÿ}š}¨TÓ2�HØ.8¸CÈÏÉ×HdÑHdÓHfÐhlÐ;mÕ.m�H—O‘O FÑ+Ø—L‘L Ô*Ø—K’K 1Õ$—Kñ	 6ô ˜"“X˜b•\�Û!�DØ—I‘I˜d–Oñ "âó! !r(   c               ó    € V ^8„  d   QhRRRR/# )r=   rŒ   r^   r>   rT   r   )r@   s   "r&   rA   rñ   |  s   € ÷ 9ñ 9 ]ð 9°sñ 9r(   c                ó.  € VP                   P                  RR4      P                  V P                  P	                  4       ^4      w  r#RP                  W P                  P	                  4       V4      pV P                  P                  P                  V^ 4      # )z2Get the number of duplicate refs of the footnote. rn   rú   z	{}ref{}{})rü   rý   rO   rE   rP   r@   r   )r#   rŒ   ÚfnrX   Úlink_ids   &&   r&   Úget_num_duplicatesÚ,FootnotePostTreeprocessor.get_num_duplicates|  so   € à—9‘9—=‘=  rÓ*×0Ñ0°·±×1MÑ1MÓ1OÐQRÓS‰ˆØ×$Ñ$ R¯©×)EÑ)EÓ)GÈÓNˆØ�~‰~×(Ñ(×,Ñ,¨W°aÓ8Ð8r(   c               ó    € V ^8„  d   QhRRRR/# ©r=   r¶   r^   r>   r?   r   )r@   s   "r&   rA   rñ   ‚  s   € ÷ /ñ /¨ð /¸$ñ /r(   c                ó€   € \        V4       F.  pV P                  V4      pV^8”  g   K  V P                  W#4       K0  	  R# )z<Find duplicate footnotes and format and add the duplicates. N)r“   r  r  )r#   r¶   rŒ   Úcounts   &&  r&   Úhandle_duplicatesÚ+FootnotePostTreeprocessor.handle_duplicates‚  s7   € ä�v–,ˆBð ×+Ñ+¨BÓ/ˆEØ�qŽyØ×#Ñ# BÖ.ó r(   c               ó    € V ^8„  d   QhRRRR/# ©r=   r]   r^   r>   r?   r   )r@   s   "r&   rA   rñ   ‹  s   € ÷ 	ñ 	˜ð 	¨$ñ 	r(   c                óÞ   € ^ V n         VP                  R4       FP  pVP                  P                  RR4      R8X  g   K&  VP                  R4       F  pV P	                  V4        KN  	  KR  	  R# )z<Crawl the footnote div and add missing duplicate footnotes. r†   r‡   rú   r*   r‰   N)r  rû   rü   rý   r  )r#   r]   r†   r‰   s   &&  r&   rÐ   ÚFootnotePostTreeprocessor.run‹  sX   € àˆŒØ—9‘9˜UÖ#ˆCØ�z‰z�~‰~˜g rÓ*¨jÖ8ð Ÿ(™( 4ž.�BØ×*Ñ*¨2Ô.Úó )ó	 $r(   )rE   r  N)r¦   r§   r¨   r©   rª   r   r  r  r  rÐ   r«   r   r(   r&   r6   r6   b  s#   † Ù/õ#õõ(9õ/÷	ñ 	r(   r6   c                  ó2   € ] tR tRtRtR R ltR R ltRtR# )	r4   i—  z2Build and append footnote div to end of document. c               ó   € V ^8„  d   QhRR/# r°   r   )r@   s   "r&   rA   Ú"FootnoteTreeprocessor.__annotate__š  rò   r(   c                	ó   € Wn         R # r³   rp   rô   s   &&r&   r   ÚFootnoteTreeprocessor.__init__š  rö   r(   c               ó    € V ^8„  d   QhRRRR/# r  r   )r@   s   "r&   rA   r  �  s   € ÷ *ñ *˜ð *¨$ñ *r(   c                	óŠ  € V P                   P                  V4      pVe¤   V P                   P                  V4      pV'       dn   Vw  rEp\        V4      P	                  V4      pV'       d%   VP                  V4       VP                  Wr4       R # VP                  V^,           V4       R Vn        R # VP                  V4       R # R # r³   )	rE   r¤   rk   r“   r    rš   rÈ   rd   ru   )r#   r]   ÚfootnotesDivÚresultrf   r¶   ÚisTextÚinds   &&      r&   rÐ   ÚFootnoteTreeprocessor.run�  s–   € Ø—~‘~×6Ñ6°tÓ<ˆØÒ#Ø—^‘^×<Ñ<¸TÓBˆFßØ(.Ñ%�˜vÜ˜6“l×(Ñ(¨Ó/�ßØ—M‘M %Ô(Ø—M‘M #Ö4à—M‘M #¨¥'¨<Ô8Ø!%�E–Jà—‘˜LÖ)ñ $r(   rp   N©r¦   r§   r¨   r©   rª   r   rÐ   r«   r   r(   r&   r4   r4   —  s   † Ù=õ#÷*ñ *r(   r4   c                  ó>   € ] tR tRtRtR R ltR R ltR R ltR	tR
# )r5   i®  z)Reorder list items in the footnotes div. c               ó   € V ^8„  d   QhRR/# r°   r   )r@   s   "r&   rA   Ú(FootnoteReorderingProcessor.__annotate__±  rò   r(   c                	ó   € Wn         R # r³   rp   rô   s   &&r&   r   Ú$FootnoteReorderingProcessor.__init__±  rö   r(   c               ó    € V ^8„  d   QhRRRR/# r  r   )r@   s   "r&   rA   r&  ´  s   € ÷ ñ ˜ð ¨$ñ r(   c                	ól  € V P                   P                   '       g   R # V P                   P                  \        V P                   P                   P                  4       4      8w  dP   VP	                  R4       F8  pVP
                  P                  RR4      R8X  g   K&  V P                  V4        R # 	  R # R # )Nr†   r‡   rú   r*   )rE   rD   r“   r”   rû   rü   rý   Úreorder_footnotes)r#   r]   r†   s   && r&   rÐ   ÚFootnoteReorderingProcessor.run´  s€   € Ø�~‰~×'×'Ð'ÙØ�>‰>×(Ñ(¬D°·±×1IÑ1I×1NÑ1NÓ1PÓ,QÔQØ—y‘y Ö'�Ø—:‘:—>‘> '¨2Ó.°*Ö<Ø×*Ñ*¨3Ô/Úó (ñ Rr(   c               ó    € V ^8„  d   QhRRRR/# r  r   )r@   s   "r&   rA   r&  ½  s   € ÷ "ñ "¨ð "¸$ñ "r(   c                	óª  a € VP                  R 4      pVP                  V4       VP                  R4      pR V 3R llp\        W4R7      p\        P
                  ! VR 4      p\        V^R7       Fa  w  rgVP                  R4      pVP                  RS P                  P                  R4      P                  V4      4       VP                  V4       Kc  	  R	# )
r‰   rŒ   c               ó   € V ^8„  d   QhRR/# )r=   r>   rT   r   )r@   s   "r&   rA   ÚCFootnoteReorderingProcessor.reorder_footnotes.<locals>.__annotate__Â  s   € ÷ 	ñ 	˜sñ 	r(   c                óX  <€ V P                   P                  R R4      P                  SP                  P	                  4       ^4      R,          pVSP                  P
                  9   d&   SP                  P
                  P                  V4      # \        SP                  P                  4      # )rn   rú   ra   )rü   rý   rO   rE   rP   rD   r    rœ   )rŒ   rn   r#   s   & €r&   Úorder_by_idÚBFootnoteReorderingProcessor.reorder_footnotes.<locals>.order_by_idÂ  sƒ   ø€ Ø—‘—‘˜t RÓ(×.Ñ.¨t¯~©~×/KÑ/KÓ/MÈqÓQÐRTÕUˆBð ˜Ÿ™×6Ñ6Ô6ð —‘×-Ñ-×3Ñ3°BÓ7ðô ˜Ÿ™×1Ñ1Ó2ðr(   )ÚkeyrŠ   z.//a[@class="footnote-backref"]r‘   r   N)rc   rš   ÚfindallÚsortedr•   r—   r˜   r   rE   r    r@   ru   )	r#   r¶   Úold_listÚitemsr2  Únew_listr    Úitemr¢   s	   f&       r&   r+  Ú-FootnoteReorderingProcessor.reorder_footnotes½  s­   ø€ Ø—;‘;˜tÓ$ˆØ�‰�hÔØ× Ñ  Ó&ˆ÷	ð 	ô �uÔ.ˆä×#Ò# F¨DÓ1ˆä$ U°!×4‰KˆEØ—y‘yÐ!BÓCˆHØ�L‰L˜ $§.¡.×":Ñ":Ð;KÓ"L×"SÑ"SÐTYÓ"ZÔ[Ø�O‰O˜DÖ!ó 5r(   rp   N)	r¦   r§   r¨   r©   rª   r   rÐ   r+  r«   r   r(   r&   r5   r5   ®  s   † Ù4õ#õ÷"ñ "r(   r5   c                  ó2   € ] tR tRtRtR R ltR R ltRtR# )	r8   iÔ  z)Replace placeholders with html entities. c               ó   € V ^8„  d   QhRR/# r°   r   )r@   s   "r&   rA   Ú"FootnotePostprocessor.__annotate__Ö  rò   r(   c                	ó   € Wn         R # r³   rp   rô   s   &&r&   r   ÚFootnotePostprocessor.__init__Ö  rö   r(   c               ó    € V ^8„  d   QhRRRR/# )r=   rb   rJ   r>   r   )r@   s   "r&   rA   r>  Ù  s   € ÷ 8ñ 8˜ð 8 ñ 8r(   c                	óŒ   € VP                  \        V P                  P                  R 4      4      pVP                  \        R4      # )r   z&#160;)r!   r›   rE   r    rž   )r#   rb   s   &&r&   rÐ   ÚFootnotePostprocessor.runÙ  s8   € Ø�|‰|Ü˜dŸn™n×6Ñ6°ÓGó
ˆð �|‰|Ô,¨hÓ7Ð7r(   rp   Nr#  r   r(   r&   r8   r8   Ô  s   † Ù4õ#÷8ñ 8r(   r8   c                 ó   € \        R/ V B # )z.Return an instance of the `FootnoteExtension` r   )r   )r$   s   ,r&   ÚmakeExtensionrE  à  s   € äÑ&˜vÑ&Ð&r(   )$rª   Ú
__future__r   rú   r   r.   r   Úinlinepatternsr   r3   r   r7   r   r   Úcollectionsr	   rÞ   rÿ   Úxml.etree.ElementTreer•   ÚElementTreeÚSTXÚETXr›   rž   rß   rQ   ÚRE_REFERENCEr   r0   r2   r6   r4   r5   r8   rE  r   r(   r&   Ú<module>rN     sà   ðñõ #å Ý ,Ý ,Ý *Ý *Ý Ý #Û 	Û ß %Ð %à—8‘8Ð4Õ4°t·x±xÕ?Ð Ø—8‘8Ð4Õ4°t·x±xÕ?Ð Ø�JŠJ�Ó'€	Ø�zŠzÐ9Ó:€ô@˜	ô @ôFW ˜^ô W ôt$˜oô $ô<2 ô 2ôj*˜Mô *ô.#" -ô #"ôL	8˜Mô 	8ô'r(   