§
    _÷#dÓ;  ã                   óŽ  — d Z ddl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j        de
¦  «         i dd“d	d
“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“i dd“d d“d!d“d"d“d#d$“d%d&“d'd(“d)d*“d+d“d,d-“d.d“d/d0“d1d
“d2d3“d4d“d5d“d6d“¥i d7d8“d9d“d:d“d;d“d<d“d=d>“d?d“d@d“dAd“dBd“dCd
“dDdE“dFdE“dGdH“dIdE“dJdH“dKd8“¥i dLdM“dNd“dOd“dPd8“dQdR“dSd
“dTd“dUd“dVd“dWd“dXd“dYd“dZd[“d\d]“d^d“d_d$“d`d&“¥dddRddd>daœ¥Zdidbedceddefde„Zej        dfdfeeeef                  dgedceddeeddf         fdh„ZdS )ju
  Deprecated backport of docutils.utils.smartquotes.

This is extracted (with minor adaptations for flake8 compliance) from
docutilsâ€™ docutils/utils/smartquotes.py as of revision 8097 (30 May 2017),
in order to backport for Sphinx usage with Docutils < 0.14 extra language
configurations and fixes. Replaces earlier smartypants version as used up
to Sphinx 1.5.6.

:copyright: Â© 2010 GÃ¼nter Milde,
            original `SmartyPants`_: Â© 2003 John Gruber
            smartypants.py:          Â© 2004, 2007 Chad Miller
:license: Released under the terms of the `2-Clause BSD license`_, in short:

   Copying and distribution of this file, with or without modification,
   are permitted in any medium without royalty provided the copyright
   notices and this notice are preserved.
   This file is offered as-is, without any warranty.

.. _SmartyPants: https://daringfireball.net/projects/smartypants/
.. _2-Clause BSD license: https://spdx.org/licenses/BSD-2-Clause

See the LICENSE file and the original docutils code for details.

é    N)Ú	GeneratorÚIterableÚTuple)Úsmartquotes)ÚRemovedInSphinx60Warningz&sphinx.util.smartypants is deprecated.Úafu   â€œâ€�â€˜â€™zaf-x-altquotu   â€žâ€�â€šâ€™Úbgu   â€žâ€œâ€šâ€˜Úcau
   Â«Â»â€œâ€�zca-x-altquotÚcszcs-x-altquotu
   Â»Â«â€ºâ€¹Údazda-x-altquotÚdezde-x-altquotzde-chu
   Â«Â»â€¹â€ºÚelÚenzen-uk-x-altquotu   â€˜â€™â€œâ€�ÚeoÚeszes-x-altquotÚetzet-x-altquotÚeuÚfiu   â€�â€�â€™â€™zfi-x-altquotu
   Â»Â»â€ºâ€ºÚfr)u   Â«Â u   Â Â»õ   â€œõ   â€�zfr-x-altquot)õ   Â«â€¯õ   â€¯Â»r   r   zfr-chzfr-ch-x-altquot)r   r   u   â€¹â€¯u   â€¯â€ºÚglÚheu
   â€�â€œÂ»Â«zhe-x-altquotÚhru   â€žâ€�â€˜â€™zhr-x-altquotÚhsbzhsb-x-altquotÚhuu
   â€žâ€�Â«Â»ÚisÚitzit-chzit-x-altquotÚjau   ã€Œã€�ã€Žã€�ÚltÚlvÚmkÚnlznl-x-altquotÚnbu
   Â«Â»â€™â€™Únnznn-x-altquotu
   Â«Â»â€˜â€™Únozno-x-altquotÚplzpl-x-altquotu
   Â«Â»â€šâ€™Úptzpt-brÚroÚruu
   Â«Â»â€žâ€œÚshzsh-x-altquotÚskzsk-x-altquotÚslzsl-x-altquotÚsqzsq-x-altquotu   â€œâ€žâ€˜â€šÚsru   â€žâ€�â€™â€™zsr-x-altquotÚsvzsv-x-altquot)Útrztr-x-altquotÚukzuk-x-altquotzzh-cnzzh-twÚtextÚlanguageÚreturnc                 ó&  — t          j        |¦  «        }	 |j        }n# t          $ r d}Y nw xY wd}t	          j        d|›d�|j        | ¦  «        } t	          j        d|›d�|j        | ¦  «        } t	          j        d|j        |j	        z   | ¦  «        } t	          j        d|j	        |j        z   | ¦  «        } | 
                    d¦  «        r"t	          j        d	|| t          j        ¬
¦  «        } d}d}t	          j        d|›d�t          j        t          j        z  ¦  «        }|                     d|j	        z   | ¦  «        } |j        |k    r5t	          j        dt          j        ¦  «        }|                     || ¦  «        } t	          j        d|›d�t          j        t          j        z  ¦  «        }	|	                     d|j        z   | ¦  «        } t	          j        d|›d�t          j        t          j        z  ¦  «        }	|	                     d|j        z  | ¦  «        } t	          j        d|j	        | ¦  «        } t	          j        d|›d�t          j        ¦  «        }
|
                     d|j        z   | ¦  «        } t	          j        d|›d�t          j        ¦  «        }|                     |j        | ¦  «        } t	          j        d|›d�t          j        ¦  «        }|                     d|j        z   | ¦  «        } t	          j        d|j        | ¦  «        } | S )u  
    Parameter:  - text string (unicode or bytes).
                - language (`BCP 47` language tag.)
    Returns:    The `text`, with "educated" curly quote characters.

    Example input:  "Isn't this fun?"
    Example output: â€œIsnâ€™t this fun?â€œ;
    u   â€™z)[!"#\$\%'()*+,-.\/:;<=>?\@\[\\\]\^_`{|}~]z^'(?=z\\B)z^"(?=z"'(?=\w)z'"(?=\w)r   z'(?=\d{2}s))Úflagsz[^\ \t\r\n\[\{\(\-]z&#8211;|&#8212;a@  
                    (
                            \s          |   # a whitespace char, or
                            &nbsp;      |   # a non-breaking space entity, or
                            --          |   # dashes, or
                            &[mn]dash;  |   # named dash entities
                            zú          |   # or decimal entities
                            &\#x201[34];    # or hex
                    )
                    '                 # the quote
                    (?=\w)            # followed by a word character
                    z\1z(?<=(\w|\d))'(?=\w)z
                    (zÄ)
                    '
                    (?!\s  |       # whitespace
                       s\b |
                        \d         # digits   ('80s)
                    )
                    zK)
                    '
                    (\s | s\b)
                    z\1%s\2ú'zú          |   # or decimal entities
                            &\#x201[34];    # or hex
                    )
                    "                 # the quote
                    (?=\w)            # followed by a word character
                    z
                    #(z�)?   # character that indicates the quote should be closing
                    "
                    (?=\s)
                    ze)   # character that indicates the quote should be closing
                    "
                    ú")r   Ú
smartcharsÚ
apostropheÚ	ExceptionÚreÚsubÚcsquoteÚcpquoteÚopquoteÚosquoteÚ
startswithÚUNICODEÚcompileÚVERBOSE)r5   r6   Úsmartr=   Úpunct_classÚclose_classÚ
dec_dashesÚopening_single_quotes_regexÚapostrophe_regexÚclosing_single_quotes_regexÚopening_double_quotes_regexÚclosing_double_quotes_regexs               ú9/usr/lib/python3/dist-packages/sphinx/util/smartypants.pyÚeducateQuotesrS      s9  € õ Ô" 8Ñ,Ô,€EðØÔ%ˆ
ˆ
øÝð ð ð Øˆ
ˆ
ˆ
ðøøøð C€Kõ
 Œ6ˆ6¨¨¨Ð5°u´}ÀdÑKÔK€DÝŒ6ˆ6¨¨¨Ð5°u´}ÀdÑKÔK€Dõ Œ6�/ 5¤=°5´=Ñ#@À$ÑGÔG€DÝŒ6�/ 5¤=°5´=Ñ#@À$ÑGÔG€Dð ×Ò˜4Ñ Ô ð NÝŒvÐ(¨*°dÅ"Ä*ÐMÑMÔMˆà,€KØ'€Jõ #%¤* *ð &˜:˜:ð.(õ *,¬µb´jÑ)@ñ#Bô #BÐð '×*Ò*¨5°5´=Ñ+@À$ÑGÔG€Dð „}˜
Ò"Ð"Ýœ:Ð&<½b¼jÑIÔIÐØ×#Ò# J°Ñ5Ô5ˆõ #%¤* *ð '˜;˜;ð.)õ +-¬*µr´zÑ*Añ#Cô #CÐð '×*Ò*¨5°5´=Ñ+@À$ÑGÔG€Då"$¤* *ð '˜;˜;ð	.)õ +-¬*µr´zÑ*Añ	#Cô #CÐð
 '×*Ò*¨9°u´}Ñ+DÀdÑKÔK€Dõ Œ6�(˜EœM¨4Ñ0Ô0€Dõ #%¤* *ð &˜:˜:ð.(õ *,¬ñ#5ô #5Ðð '×*Ò*¨5°5´=Ñ+@À$ÑGÔG€Dõ #%¤* *ð '˜;˜;ð	.)õ +-¬*ñ	#6ô #6Ðð
 '×*Ò*¨5¬=¸$Ñ?Ô?€Då"$¤* *ð '˜;˜;ð.)õ +-¬*ñ#6ô #6Ðð '×*Ò*¨5°5´=Ñ+@À$ÑGÔG€Dõ Œ6�$˜œ tÑ,Ô,€Dà€Ks   – ž-¬-Útext_tokensÚattrc              #   óÒ  K  — d}d}d}d}d}d}|dk    rd}d}d}nU|dk    rd}d}d}nH|dk    r	d}d}d	}d}n9|d
k    rd}n0d|v rd}d|v rd}d|v rd}d|v rd}d|v rd}d|v rd	}d|v rd}d|v rd}d}	| D �]p\  }
}|
dk    s|s|V — Œ|
dk    r|dd…         }	|V — Œ(|dd…         }t          j        |¦  «        }|rt          j        dd|¦  «        }|dk    rt          j        |¦  «        }n5|dk    rt          j        |¦  «        }n|d	k    rt          j        |¦  «        }|rt          j        |¦  «        }|rt          j        ||¦  «        }|dk    rt          j	        ||¦  «        }|rE|	 
                    dd¦  «         
                    dd¦  «        }t          ||z   |¦  «        dd…         }|rt          j        ||¦  «        }|}	t          j        |d¬¦  «        }|V — �ŒrdS )a5  Return iterator that "educates" the items of `text_tokens`.

    This is modified to intercept the ``attr='2'`` as it was used by the
    Docutils 0.13.1 SmartQuotes transform in a hard coded way. Docutils 0.14
    uses ``'qDe'``` and is configurable, and its choice is backported here
    for use by Sphinx with earlier Docutils releases. Similarly ``'1'`` is
    replaced by ``'qde'``.

    Use ``attr='qDbe'``, resp. ``'qdbe'`` to recover Docutils effect of ``'2'``,
    resp. ``'1'``.

    refs: https://sourceforge.net/p/docutils/mailman/message/35869025/
    Fr   Ú1Té   Ú2é   Ú3é   z-1ÚqÚbÚBÚdÚDÚiÚeÚwú ÚtagÚliteraléÿÿÿÿNz&quot;r;   ú;r:   )Úrestore)r   ÚprocessEscapesr?   r@   ÚeducateDashesÚeducateDashesOldSchoolÚeducateDashesOldSchoolInvertedÚeducateEllipsesÚeducateBackticksÚeducateSingleBackticksÚreplacerS   ÚstupefyEntities)rT   rU   r6   Úconvert_quotÚ	do_dashesÚdo_backticksÚ	do_quotesÚdo_ellipsesÚ
do_stupefyÚprev_token_last_charÚttyper5   Ú	last_charÚcontexts                 rR   Úeducate_tokensr~   ñ   sÈ  è è € ðB €LØ€IØ€LØ€IØ€KØ€Jàˆs‚{€{Øˆ	àˆ	ØˆˆØ	�Šˆàˆ	àˆ	ØˆˆØ	�Šˆàˆ	ØˆØˆ	ØˆˆØ	�ŠˆØˆ
ˆ
à�$ˆ;ˆ;ØˆIØ�$ˆ;ˆ;ØˆLØ�$ˆ;ˆ;ØˆLØ�$ˆ;ˆ;ØˆIØ�$ˆ;ˆ;ØˆIØ�$ˆ;ˆ;ØˆIØ�$ˆ;ˆ;ØˆKØ�$ˆ;ˆ;ØˆLàÐð %ð 4ñ 4‰ˆ�ð �EŠ>ˆ> ˆ>ØˆJˆJˆJØð �IÒÐØ#'¨¨¨¤9Ð ØˆJˆJˆJØà˜˜˜”Iˆ	åÔ)¨$Ñ/Ô/ˆàð 	/Ý”6˜( C¨Ñ.Ô.ˆDà˜Š>ˆ>ÝÔ,¨TÑ2Ô2ˆDˆDØ˜!Š^ˆ^ÝÔ5°dÑ;Ô;ˆDˆDØ˜!Š^ˆ^ÝÔ=¸dÑCÔCˆDàð 	5ÝÔ.¨tÑ4Ô4ˆDð ð 	@ÝÔ/°°hÑ?Ô?ˆDà˜1ÒÐÝÔ5°d¸HÑEÔEˆDàð 	?ð +×2Ò2°3¸Ñ<Ô<×DÒDÀSÈ#ÑNÔNˆGÝ  ¨4¡°Ñ:Ô:¸1¸2¸2Ô>ˆDàð 	?ÝÔ.¨t°XÑ>Ô>ˆDð  )ÐåÔ)¨$¸Ð=Ñ=Ô=ˆàˆ
ˆ
ˆ
‰
ði4ð 4ó    )r   )Ú__doc__r?   ÚwarningsÚtypingr   r   r   Údocutils.utilsr   Úsphinx.deprecationr   ÚwarnÚ
langquotesÚstrrS   Údefault_smartypants_attrr~   © r   rR   ú<module>rŠ      s;  ððð ð2 
€	€	€	Ø €€€Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -Ð -à &Ð &Ð &Ð &Ð &Ð &à 7Ð 7Ð 7Ð 7Ð 7Ð 7à €„Ð6Ø&ñ(ô (ð (ðWˆd˜nð WØ˜nðWà˜nðWð ˜lðWð ˜nð	Wð
 ˜nðWð ˜lðWð ˜lðWð ˜nðWð ˜nðWð ˜lðWð ˜lðWð ˜lðWð ˜nðWð   ðWð  ˜nð!Wð" ˜lð#Wð Wð$ ˜nð%Wð& ˜nð'Wð( ˜lð)Wð* ˜lð+Wð, ˜nð-Wð. ˜lð/Wð0 Ð<ð1Wð2 Ð>ð3Wð4 ˜lð5Wð6  Ð!Hð7Wð: ˜lð;Wð< ˜lð=Wð> ˜nð?WðB ˜nðCWðD ˜lðEWðF ˜nðGWðH ˜|ðIWð Wð WðJ ˜lðKWðL ˜nðMWðN ˜lðOWðP ˜lðQWðR ˜nðSWðV ˜nðWWðX ˜nðYWðZ ˜nð[Wð\ ˜nð]Wð` ˜nðaWðb ˜nðcWðf ˜lðgWðh ˜lðiWðj ˜lðkWðp ˜lðqWðr ˜lðsWðx ˜lðyWð Wð Wðz ˜lð{Wð@ ˜lðAWðB ˜nðCWðD ˜lðEWðF ˜lðGWðH ˜nðIWðJ ˜lðKWðL ˜nðMWðN ˜lðOWðP ˜nðQWðR ˜lðSWðT ˜lðUWðV ˜nðWWðX ˜nðYWðZ ˜lð[Wð\ ˜nð]Wð^ ˜lð_Wð Wð` -Ø*à*Ø,Ø,Ø,ðmWð Wð W€
ðtoð o˜ð o sð o°cð oð oð oð oðf  +ÔCØ#'ðEð E ¨¨s°C¨x¬Ô 9ð EØðEà ðEð " # t¨T /Ô2ðEð Eð Eð Eð Eð Er   